<template>
  <div class="AbnormalData">
    <a-card title="异常员工" class="card" :bordered="false">
      <a-table
        :rowKey="data => data.jds_user_id"
        :columns="columns"
        :loading="loading"
        :dataSource="data" >
        <a slot="jds_user_id" slot-scope="text" @click="goiss(text)">查看详情</a>
      </a-table>
    </a-card>
  </div>
</template>

<script>
import { getNormalList } from '@/api/admin/user'
const columns = [
  {
    title: '员工',
    dataIndex: 'user'
  },
  {
    title: '昨天',
    dataIndex: 'yes'
  },
  {
    title: '前天',
    dataIndex: 'las'

  },
  {
    title: '相差',
    dataIndex: 'number',
    scopedSlots: { customRender: 'number' }
  },
  {
    title: '详情',
    dataIndex: 'jds_user_id',
    scopedSlots: { customRender: 'jds_user_id' }
  }
]

const data = [
  // {
  //   jds_user_id: 6,
  //   user: 'acc',
  //   yes: 500,
  //   las: 400,
  //   number: 12
  // }
]
export default {
  name: 'AbnormalData',
  data () {
    return {
      columns,
      data,
      loading: false,
      skeLoading: true
    }
  },

  computed: {},
  created () {
    this.getNormalList()
  },
  mounted () {},
  methods: {
    goiss (val) {
      // console.log(val)
      this.$router.push({
        path: `/admin/issue-data`,
        query: {
          id: val
        }
      })
    },
    getNormalList () {
      this.loading = true
      getNormalList({})
        .then(res => {
          // console.log('异常', res.result)
          this.data = res.result
          this.skeLoading = false
          this.loading = false
          // console.log(this.data)
        })
        .catch(() => {
          this.skeLoading = false
          this.loading = false
        })
    }
  }
}
</script>

<style lang='less' scoped>
</style>
